using UnityEngine;
using UnityEngine.Rendering.Universal;

public class GlobalLightController : OptionalArea
{
    private Light2D globalLight;

    private bool isPause = false;

    protected override void Awake()
    {
        base.Awake();
        globalLight = GetComponent<Light2D>();
    }

    private void Update()
    {
        if (isPause)
        {
            globalLight.intensity = Mathf.Clamp(globalLight.intensity - 0.01f, 0, 1);

        }
        else
        {
            globalLight.intensity = Mathf.Clamp(globalLight.intensity + 0.01f, 0, 1);
        }
    }


    protected override void Pause(bool isPause)
    {
            this.isPause = isPause;
    }

    protected override void ChosenEvent(string msg)
    {

    }

}
